package org.springcloud.wisdom.amusement.controller.sys;

import org.springcloud.wisdom.amusement.bean.ResponseData;
import org.springcloud.wisdom.amusement.controller.BaseController;
import org.springcloud.wisdom.amusement.entity.Student;
import org.springcloud.wisdom.amusement.service.IStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
@RequestMapping("/sys/funstudent2")
public class StudentController2 extends BaseController {
    @Autowired
    IStudentService studentService;
    //获取学生分页信息
    @GetMapping("gets")
    public ResponseData<Object> getAStudent(int currentPage, int size) {
        return returnObject(studentService.getStudentPage(currentPage, size));
    }
    //获取学生信息
    @GetMapping("gets1")
    public ResponseData<Object> getStudentPage(String sid) {
        return returnObject(studentService.getAStudent(sid));
    }
    //更新学生信息
    @PutMapping("update")
    public ResponseData<Boolean> updateStudent(@RequestBody Student student) {
        return returnBoolean(studentService.updateStudent(student));
    }
}
